Skip to content

Pin a second tags: block and how the tags: line is matched - #47

Merged
dmccoystephenson merged 1 commit into
mainfrom
feature/second-tags-block-tests
Nov 13, 2026
Merged

dmccoystephenson merged 1 commit into
mainfrom
feature/second-tags-block-tests

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

Stage B — unit-test expansion (server-wide config: the tags: line and a second tags: block).

Summary

Two characterization tests are added to TraceClientTest. Production code is unchanged.

  • serverWideTags_aSecondTagsBlockAddsToTheFirstAndTheFirstEntryOfAKeyWins: a file with two tags: blocks is read as one merged set of tags. Each block takes its own entry indent, because parseServerWideConfig resets entryIndent at every tags: line. A key already read from an earlier block is not replaced, because addServerWideTag keeps the first entry. No test drove a second block before.
  • serverWideTags_theTagsLineIsCaseSensitiveAndAllowsSpaceBeforeTheColon: TAGS_LINE (^tags\s*:\s*(#.*)?$) accepts tags :. It rejects Tags: and a tags: line that carries a value. Under a line that does not open a block, an indented enabled: false is outside any tags: block, so it is the switch. That matches the parseServerWideConfig Javadoc ("the first enabled: line outside a tags: block is the switch").

Both tests assert the current behaviour. Neither one changes it. The README and the Javadoc describe "a tags: block" and do not say what a second block does. The merge behaviour is now pinned, and no documentation change is made in this PR.

Skipped issues

Every open issue was left out for one reason: each needs a maintainer decision on the opt-out contract or the tag rules, which is a do-not-auto-merge area.

Test plan

  • mvn -B verify run locally on Java 21: Tests run: 113, Failures: 0, Errors: 0, Skipped: 0. The surefire report includes both new tests.
  • CI matrix build (8), build (17), build (21) green on the PR head.

No tracking issue; this gap was found during triage.

This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).

🤖 Generated with Claude Code


drafted by Claude on behalf of Daniel Stephenson

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dmccoystephenson

Copy link
Copy Markdown
Member Author

Self-review rubric (scored against the diff and CI on head a287efa):

  • Scope: PASS. Only src/test/java/software/stephenson/trace/TraceClientTest.java is modified (+41 lines, two new tests). Production code is unchanged.
  • Tests-new: PASS (not applicable). No public method is added.
  • Tests-fix: not applicable. This is a characterization-only Stage B cycle with no bug fix.
  • Sibling structure: PASS. The tests sit beside serverWideTags_blockEndsAtTheNextUnindentedLineOrEndOfFile, follow the subject_behaviour naming and use the existing tagsOf helper and parseServerWideConfig.
  • Sibling renames: PASS (not applicable). Nothing is renamed.
  • Docs: PASS, with one observation. The README "Server-wide tags" section and the parseServerWideConfig Javadoc speak of "a tags: block" and do not say what a second block does. The tests pin the current merge (first entry of a key wins), and no documentation change is made. The README section is not on the do-not-auto-merge list, but a doc sentence is left for a later Stage A cycle so this PR stays test-only.
  • Issue resolution: PASS (not applicable). No Closes. The gap was found during triage.
  • CI: PASS. build (8), build (17) and build (21) are green on the head. Locally, mvn -B verify on Java 21 ran 113 tests with 0 failures, and the surefire XML names both new tests.

Repo-specific:

  • No dependencies / Single file / Java 8: PASS. pom.xml and src/main are untouched. The new tests use only Arrays.asList, Collections and LinkedHashMap, and build (8) is green.
  • Never throws / Non-blocking / Environment seam / Version agreement / Opt-out contract: PASS (not applicable). No production code changed.

Judgment call, folded in here because it is not anchored to a changed line:

  • src/test/java/software/stephenson/trace/TraceClientTest.java (serverWideTags_theTagsLineIsCaseSensitiveAndAllowsSpaceBeforeTheColon): the test pins that an indented enabled: false under a Tags: line (capital T, so no block opens) turns reporting off. That follows the documented rule ("the first enabled: line outside a tags: block is the switch") and fails safe toward opting out. If the maintainer prefers otherwise, this assertion is the one to change.

Summary: a test-only PR that pins two parser behaviours no test drove before. CI is green, and no do-not-auto-merge path is touched.

This comment was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).


drafted by Claude on behalf of Daniel Stephenson

@dmccoystephenson
dmccoystephenson merged commit d678e73 into main Nov 13, 2026
3 checks passed
@dmccoystephenson
dmccoystephenson deleted the feature/second-tags-block-tests branch November 13, 2026 02:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant